/*
 * A simple ToDo Manager
 *
 * Copyright (c) 2011 Nosheen Zaza, Manuel Rebollo, Seyedsaeid Mahpeikar and
 * Wo Ke
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

package todomanager.ui.dialogs;

import java.awt.BorderLayout;
import java.awt.Component;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import todomanager.ui.ActionControl;

/**
 *  An instance of this class shows a dialog showing how to use
 *  the ToDo Manager
 * 
 * @author
 * Manuel Rebollo
 */
public class HowToUseDialog extends JDialog {

    private JTextArea textLabel;
    private JScrollPane taskScroll;
    private JPanel contentPanel;

    /**
     * Creates a new instance.
     */
    public HowToUseDialog() {
        setTitle( ActionControl.getInstance().getStringsBundle().getString("howTo"));

        textLabel = new JTextArea(
                ActionControl.getInstance().getStringsBundle().getString("howToUseText"));
        textLabel.setColumns(130);
        textLabel.setEditable(false);
        textLabel.setLineWrap(true);
        textLabel.setWrapStyleWord(true);
        textLabel.setFocusable(true);
        taskScroll = new JScrollPane(textLabel);
        taskScroll.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
        taskScroll.setAlignmentX(Component.LEFT_ALIGNMENT);

        contentPanel = new JPanel();

        contentPanel.setLayout(new BoxLayout(contentPanel, BoxLayout.PAGE_AXIS));

        contentPanel.add(taskScroll);

        setTitle(ActionControl.getInstance().getStringsBundle().getString("howTo"));
        textLabel.setText(ActionControl.getInstance().getStringsBundle().getString("howToUseText"));
        
        setLayout(new BorderLayout());
        add(contentPanel, BorderLayout.CENTER);
        setSize(300, 300);
        setResizable(false);
        setLocationRelativeTo(ActionControl.getInstance().getMainWindow());
    }
}
